vditor 3.10.9 → 3.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019 B3log 开源, b3log.org
3
+ Copyright (c) 2019-present B3log 开源, b3log.org
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -201,7 +201,7 @@ Markdown 输出的 HTML 所展现的外观。内置 ant-design, light,dark,w
201
201
  | minHeight | 编辑区域最小高度 | - |
202
202
  | width | 编辑器总宽度,支持 % | 'auto' |
203
203
  | placeholder | 输入区域为空时的提示 | '' |
204
- | lang | 语言种类:en_US, fr_FR, pt_BR, ja_JP, ko_KR, ru_RU, sv_SE, zh_CN, zh_TW | 'zh_CN' |
204
+ | lang | 语言种类:de_DE, en_US, fr_FR, pt_BR, ja_JP, ko_KR, ru_RU, sv_SE, zh_CN, zh_TW | 'zh_CN' |
205
205
  | input(value: string) | 输入后触发 | - |
206
206
  | focus(value: string) | 聚焦后触发 | - |
207
207
  | blur(value: string) | 失焦后触发 | - |
@@ -209,6 +209,7 @@ Markdown 输出的 HTML 所展现的外观。内置 ant-design, light,dark,w
209
209
  | esc(value: string) | <kbd>esc</kbd> 按下后触发 | - |
210
210
  | ctrlEnter(value: string) | <kbd>⌘/ctrl+enter</kbd> 按下后触发 | - |
211
211
  | select(value: string) | 编辑器中选中文字后触发 | - |
212
+ | unSelect() | 编辑器中未选中文字后触发 | - |
212
213
  | tab | <kbd>tab</kbd> 键操作字符串,支持 `\t` 及任意字符串 | - |
213
214
  | typewriterMode | 是否启用打字机模式 | false |
214
215
  | cdn | 配置自建 CDN 地址 | `https://unpkg.com/vditor@${VDITOR_VERSION}` |
@@ -464,6 +465,7 @@ if (xhr.status === 200) {
464
465
 
465
466
  | | 说明 | 默认值 |
466
467
  | - | - | - |
468
+ | xhr | 上传时使用的 XMLHttpRequest | - |
467
469
  | url | 上传 url,为空则不会触发上传相关事件 | '' |
468
470
  | max | 上传文件最大 Byte | 10 * 1024 * 1024 |
469
471
  | linkToImgUrl | 剪切板中包含图片地址时,使用此 url 重新上传 | '' |
@@ -480,6 +482,7 @@ if (xhr.status === 200) {
480
482
  | handler(files: File[]) => string \| null \| Promise<string> \| Promise<null> | 自定义上传,当发生错误时返回错误信息 | - |
481
483
  | format(files: File[], responseText: string): string | 对服务端返回的数据进行转换,以满足内置的数据结构 | - |
482
484
  | file(files: File[]): File[] \| Promise<File[]> | 将上传的文件处理后再返回 | - |
485
+ | cancel(files: File[]): void | 取消正在上传的文件 | - |
483
486
  | setHeaders(): { [key: string]: string } | 上传前使用返回值设置头 | - |
484
487
  | extraData: { [key: string]: string \| Blob } | 为 FormData 添加额外的参数 | - |
485
488
  | multiple | 上传文件是否为多个 | true |
package/dist/index.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vditor v3.10.9 - A markdown editor written in TypeScript.
2
+ * Vditor v3.11.1 - A markdown editor written in TypeScript.
3
3
  *
4
4
  * MIT License
5
5
  *
@@ -25,7 +25,7 @@
25
25
  *
26
26
  */
27
27
  /*!
28
- * Vditor v3.10.9 - A markdown editor written in TypeScript.
28
+ * Vditor v3.11.1 - A markdown editor written in TypeScript.
29
29
  *
30
30
  * MIT License
31
31
  *
@@ -277,8 +277,9 @@
277
277
  z-index: 3;
278
278
  font-size: 14px;
279
279
  display: none;
280
- -moz-user-select: none;
281
- user-select: none;
280
+ -webkit-user-select: none;
281
+ -moz-user-select: none;
282
+ user-select: none;
282
283
  max-width: 320px;
283
284
  min-width: 80px;
284
285
  animation-duration: 0.15s;
@@ -599,8 +600,9 @@
599
600
  background-color: var(--count-background-color);
600
601
  border-radius: 3px;
601
602
  font-size: 12px;
602
- -moz-user-select: none;
603
- user-select: none;
603
+ -webkit-user-select: none;
604
+ -moz-user-select: none;
605
+ user-select: none;
604
606
  float: right;
605
607
  margin: 8px 3px 0 0;
606
608
  }
@@ -611,8 +613,9 @@
611
613
  .vditor-resize {
612
614
  padding: 3px 0;
613
615
  cursor: row-resize;
614
- -moz-user-select: none;
615
- user-select: none;
616
+ -webkit-user-select: none;
617
+ -moz-user-select: none;
618
+ user-select: none;
616
619
  position: absolute;
617
620
  width: 100%;
618
621
  }
@@ -722,8 +725,9 @@
722
725
  align-items: center;
723
726
  cursor: pointer;
724
727
  margin-left: 24px;
725
- -moz-user-select: none;
726
- user-select: none;
728
+ -webkit-user-select: none;
729
+ -moz-user-select: none;
730
+ user-select: none;
727
731
  color: var(--toolbar-icon-color);
728
732
  }
729
733
  .vditor-img__btn:hover {
@@ -1115,12 +1119,13 @@
1115
1119
  .vditor-linenumber__rows {
1116
1120
  position: absolute;
1117
1121
  pointer-events: none;
1118
- top: 0.5em;
1122
+ top: 1em;
1119
1123
  left: 0;
1120
1124
  width: 3em;
1121
1125
  /* works for line-numbers below 1000 lines */
1122
- -moz-user-select: none;
1123
- user-select: none;
1126
+ -webkit-user-select: none;
1127
+ -moz-user-select: none;
1128
+ user-select: none;
1124
1129
  counter-reset: linenumber;
1125
1130
  }
1126
1131
  .vditor-linenumber__rows > span {
@@ -1249,8 +1254,9 @@
1249
1254
  }
1250
1255
  .vditor-toc {
1251
1256
  margin-bottom: 16px;
1252
- -moz-user-select: text;
1253
- user-select: text;
1257
+ -webkit-user-select: text;
1258
+ -moz-user-select: text;
1259
+ user-select: text;
1254
1260
  color: #4285f4;
1255
1261
  }
1256
1262
  .vditor-toc .vditor-outline__action {
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import VditorMethod from "./method";
4
4
  declare class Vditor extends VditorMethod {
5
5
  readonly version: string;
6
6
  vditor: IVditor;
7
+ private isDestroyed;
7
8
  /**
8
9
  * @param id 要挂载 Vditor 的元素或者元素 ID。
9
10
  * @param options Vditor 参数